net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive#63825
Merged
Conversation
Collaborator
|
Review requested:
|
88d729f to
da04b2d
Compare
Signed-off-by: Guy Bedford <guybedford@gmail.com>
addaleax
approved these changes
Jun 11, 2026
Collaborator
lpinca
approved these changes
Jun 13, 2026
Collaborator
Commit Queue failed- Loading data for nodejs/node/pull/63825 ✔ Done loading data for nodejs/node/pull/63825 ----------------------------------- PR info ------------------------------------ Title net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive (#63825) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch guybedford:tcp-keepalive -> nodejs:main Labels c++, net, semver-minor, author ready, needs-ci Commits 2 - net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive - add options bag variant Committers 1 - Guy Bedford <gbedford@cloudflare.com> PR-URL: https://github.com/nodejs/node/pull/63825 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/63825 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 09 Jun 2026 23:04:58 GMT ✔ Approvals: 3 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/63825#pullrequestreview-4480901640 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/63825#pullrequestreview-4491068882 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/63825#pullrequestreview-4491927594 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-06-13T08:03:07Z: https://ci.nodejs.org/job/node-test-pull-request/74085/ - Querying data for job/node-test-pull-request/74085/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 63825 From https://github.com/nodejs/node * branch refs/pull/63825/merge -> FETCH_HEAD ✔ Fetched commits as 96cff6096ad7..2f3323944e40 -------------------------------------------------------------------------------- [main 27e6c29fed] net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive Author: Guy Bedford <gbedford@cloudflare.com> Date: Tue Jun 9 15:33:52 2026 -0700 5 files changed, 109 insertions(+), 9 deletions(-) create mode 100644 test/parallel/test-net-keepalive-interval-count.js [main 24f128b6cb] add options bag variant Author: Guy Bedford <gbedford@cloudflare.com> Date: Fri Jun 12 14:58:47 2026 -0700 4 files changed, 116 insertions(+), 24 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. (node:463) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/4) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlivehttps://github.com/nodejs/node/actions/runs/27479323544 |
addaleax
approved these changes
Jun 13, 2026
Collaborator
|
Landed in 1efdce3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This extends
setKeepAlive()fornet.Socketbased on the newer UVuv_tcp_keepalive_exextension with allows setting these optional arguments for the probe interval and probe count, effectively closing the gap onsetsockopt(2)compatibility.This does not extend this option to other constructors accepting keepalive options currently although that could also be added as well.
Both new values default to the previous libuv behaviour (1000 ms interval, 10 probes), so existing calls are unaffected.